home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / DriverFamilyMatching.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  6.5 KB  |  208 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        DriverFamilyMatching.h
  3.  
  4.      Contains:    xxx put contents here xxx
  5.  
  6.      Version:    Technology:    
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DRIVERFAMILYMATCHING__
  19. #define __DRIVERFAMILYMATCHING__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __NAMEREGISTRY__
  25. #include <NameRegistry.h>
  26. #endif
  27. #ifndef __CODEFRAGMENTS__
  28. #include <CodeFragments.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. /*
  54.   ##############################################
  55.    Well known properties in the Name Registry
  56.   ##############################################
  57. */
  58.  
  59. #define kPropertyName                    "name"
  60. #define kPropertyCompatible                "compatible"
  61. #define    kPropertyDriverPtr                "driver-ptr"
  62. #define kPropertyDriverDesc                "driver-description"
  63. #define kPropertyReg                    "reg"
  64. #define kPropertyAAPLAddress            "AAPL,address"
  65. #define kPropertyMatching                "matching"
  66.  
  67. /* CPassThru */
  68. /*
  69.   #########################################################
  70.    Descriptor for Drivers and NDRVs
  71.   #########################################################
  72. */
  73. /* Driver Typing Information Used to Match Drivers With Devices */
  74.  
  75. struct MacDriverType {
  76.     Str31                             nameInfoStr;                /* Driver Name/Info String*/
  77.     NumVersion                         version;                    /* Driver Version Number*/
  78. };
  79. typedef struct MacDriverType            MacDriverType;
  80.  
  81. typedef MacDriverType *                    DriverTypePtr;
  82. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  83. typedef OptionBits                         RuntimeOptions;
  84.  
  85. enum {
  86.     kDriverIsLoadedUponDiscovery = 0x00000001,                    /* auto-load driver when discovered*/
  87.     kDriverIsOpenedUponLoad        = 0x00000002,                    /* auto-open driver when loaded*/
  88.     kDriverIsUnderExpertControl    = 0x00000004,                    /* I/O expert handles loads/opens*/
  89.     kDriverIsConcurrent            = 0x00000008,                    /* supports concurrent requests*/
  90.     kDriverQueuesIOPB            = 0x00000010,                    /* device manager doesn't queue IOPB*/
  91.     kDriverIsLoadedAtBoot        = 0x00000020,                    /* Driver is loaded at the boot time */
  92.     kDriverIsForVirtualDevice    = 0x00000040,                    /* Driver is for a virtual Device */
  93.     kDriverSupportDMSuspendAndResume = 0x00000080                /* Driver supports Device Manager Suspend and Resume command */
  94. };
  95.  
  96.  
  97. struct DriverOSRuntime {
  98.     RuntimeOptions                     driverRuntime;                /* Options for OS Runtime*/
  99.     Str31                             driverName;                    /* Driver's name to the OS*/
  100.     UInt32                             driverDescReserved[8];        /* Reserved area*/
  101. };
  102. typedef struct DriverOSRuntime            DriverOSRuntime;
  103. typedef DriverOSRuntime *                DriverOSRuntimePtr;
  104. /* OS Service Information Used To Declare What APIs a Driver Supports */
  105.  
  106. typedef UInt32                             ServiceCount;
  107.  
  108. struct DriverServiceInfo {
  109.     OSType                             serviceCategory;            /* Service Category Name*/
  110.     OSType                             serviceType;                /* Type within Category*/
  111.     NumVersion                         serviceVersion;                /* Version of service*/
  112. };
  113. typedef struct DriverServiceInfo        DriverServiceInfo;
  114. typedef DriverServiceInfo *                DriverServiceInfoPtr;
  115.  
  116. struct DriverOSService {
  117.     ServiceCount                     nServices;                    /* Number of Services Supported*/
  118.     DriverServiceInfo                 service[1];                    /* The List of Services (at least one)*/
  119. };
  120. typedef struct DriverOSService            DriverOSService;
  121. typedef DriverOSService *                DriverOSServicePtr;
  122. /* Categories */
  123.  
  124. enum {
  125.     kServiceCategoryDisplay        = FOUR_CHAR_CODE('disp'),        /* Display Manager*/
  126.     kServiceCategoryOpenTransport = FOUR_CHAR_CODE('otan'),        /* Open Transport*/
  127.     kServiceCategoryBlockStorage = FOUR_CHAR_CODE('blok'),        /* Block Storage*/
  128.     kServiceCategoryNdrvDriver    = FOUR_CHAR_CODE('ndrv'),        /* Generic Native Driver*/
  129.     kServiceCategoryScsiSIM        = FOUR_CHAR_CODE('scsi'),        /* SCSI */
  130.     kServiceCategoryFileManager    = FOUR_CHAR_CODE('file'),        /* File Manager */
  131.     kServiceCategoryIDE            = FOUR_CHAR_CODE('ide-'),        /* ide */
  132.     kServiceCategoryADB            = FOUR_CHAR_CODE('adb-'),        /* adb */
  133.     kServiceCategoryPCI            = FOUR_CHAR_CODE('pci-'),        /* pci bus */
  134.                                                                 /* Nu Bus */
  135.     kServiceCategoryDFM            = FOUR_CHAR_CODE('dfm-'),        /* DFM */
  136.     kServiceCategoryMotherBoard    = FOUR_CHAR_CODE('mrbd'),        /* mother Board */
  137.     kServiceCategoryKeyboard    = FOUR_CHAR_CODE('kybd'),        /* Keyboard */
  138.     kServiceCategoryPointing    = FOUR_CHAR_CODE('poit'),        /* Pointing */
  139.     kServiceCategoryRTC            = FOUR_CHAR_CODE('rtc-'),        /* RTC */
  140.     kServiceCategoryNVRAM        = FOUR_CHAR_CODE('nram'),        /* NVRAM */
  141.     kServiceCategorySound        = FOUR_CHAR_CODE('sond'),        /* Sound (1/3/96 MCS) */
  142.     kServiceCategoryPowerMgt    = FOUR_CHAR_CODE('pgmt'),        /* Power Management */
  143.     kServiceCategoryGeneric        = FOUR_CHAR_CODE('genr')        /* Generic Service Category to receive general Events */
  144. };
  145.  
  146. /* Ndrv ServiceCategory Types */
  147.  
  148. enum {
  149.     kNdrvTypeIsGeneric            = FOUR_CHAR_CODE('genr'),        /* generic*/
  150.     kNdrvTypeIsVideo            = FOUR_CHAR_CODE('vido'),        /* video*/
  151.     kNdrvTypeIsBlockStorage        = FOUR_CHAR_CODE('blok'),        /* block storage*/
  152.     kNdrvTypeIsNetworking        = FOUR_CHAR_CODE('netw'),        /* networking*/
  153.     kNdrvTypeIsSerial            = FOUR_CHAR_CODE('serl'),        /* serial*/
  154.     kNdrvTypeIsParallel            = FOUR_CHAR_CODE('parl'),        /* parallel */
  155.     kNdrvTypeIsSound            = FOUR_CHAR_CODE('sond'),        /* sound*/
  156.     kNdrvTypeIsBusBridge        = FOUR_CHAR_CODE('brdg')
  157. };
  158.  
  159.  
  160. typedef UInt32                             DriverDescVersion;
  161. /*    The Driver Description */
  162.  
  163. enum {
  164.     kInitialDriverDescriptor    = 0,
  165.     kVersionOneDriverDescriptor    = 1
  166. };
  167.  
  168.  
  169. enum {
  170.     kTheDescriptionSignature    = FOUR_CHAR_CODE('mtej'),
  171.     kDriverDescriptionSignature    = FOUR_CHAR_CODE('pdes')
  172. };
  173.  
  174.  
  175.  
  176. struct DriverDescription {
  177.     OSType                             driverDescSignature;        /* Signature field of this structure*/
  178.     DriverDescVersion                 driverDescVersion;            /* Version of this data structure*/
  179.     MacDriverType                     driverType;                    /* Type of Driver*/
  180.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  181.     DriverOSService                 driverServices;                /* Apple Service API Membership*/
  182. };
  183. typedef struct DriverDescription        DriverDescription;
  184. typedef DriverDescription *                DriverDescriptionPtr;
  185.  
  186.  
  187.  
  188. #if PRAGMA_STRUCT_ALIGN
  189.     #pragma options align=reset
  190. #elif PRAGMA_STRUCT_PACKPUSH
  191.     #pragma pack(pop)
  192. #elif PRAGMA_STRUCT_PACK
  193.     #pragma pack()
  194. #endif
  195.  
  196. #ifdef PRAGMA_IMPORT_OFF
  197. #pragma import off
  198. #elif PRAGMA_IMPORT
  199. #pragma import reset
  200. #endif
  201.  
  202. #ifdef __cplusplus
  203. }
  204. #endif
  205.  
  206. #endif /* __DRIVERFAMILYMATCHING__ */
  207.  
  208.